<?php $this; /* @var $this \Comm\View */  ?>
<?php $this->_block('content'); ?>

<div class="panel panel-info">
	<div class="panel-heading"><?= _('基本设置') ?></div>
	<div class="panel-body">
		<form id="form-manage-basic" action="<?= $this->path('aj/manage/basic/savebasic') ?>" class="form-horizontal" method="post" onsubmit="return false">
			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-name"><?= _('博客名称'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-name" name="name" placeholder="<?= _('用于展示于标题位置'); ?>" value="<?= $basic['name']; ?>" />
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-desc"><?= _('博客描述'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-desc" name="desc" placeholder="<?= _('用简洁的文字描述博客'); ?>" value="<?= $basic['desc']; ?>" />
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-1 control-label"><?= _('分页设置'); ?></label>
				<div class="col-sm-5" id="input-page_count-radioset">
				<div class="btn-group" data-toggle="buttons">
        			<?php foreach([10, 20, 50, 100] as $value) : ?>
        			<label class="btn btn-default<?php if($basic['page_count'] == $value) : ?> active<?php endif; ?>" for="input-page_count-<?= $value ?>">
                    	<input type="radio" autocomplete="off" id="input-page_count-<?= $value ?>" name="page_count" value="<?= $value ?>"<?php if($basic['page_count'] == $value) : ?> checked="checkekd"<?php endif; ?> /><?= $value ?>
                    </label>
                    <?php endforeach; ?>
                </div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-comment_youyan"><?= _('评论设置'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-comment_youyan" name="comment_youyan" placeholder="<?= _('请填入友言UID'); ?>" value="<?= $basic['comment_youyan'] ?>" />
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-timezone"><?= _('时区设置'); ?></label>
				<div class="col-sm-5">
					<select class="form-control" id="input-timezone" name="timezone">
                        <?php foreach(DateTimeZone::listIdentifiers() as $value) : ?>
                        <option value="<?= $value ?>" <?php if($basic['timezone'] == $value) : ?> selected="selected" <?php endif; ?>><?= $value ?></option>
                        <?php endforeach; ?>
            		</select>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-offset-1 col-sm-11">
					<button type="submit" class="btn btn-info"><?= _('保存') ?></button>
				</div>
			</div>
		</form>
	</div>
</div>


<div class="panel panel-info">
	<div class="panel-heading"><?= _('图片上传设置（七牛免费CDN）') ?></div>
	<div class="panel-body">
		<form id="form-manage-qiniu" action="<?= $this->path('aj/manage/basic/saveqiniu') ?>" class="form-horizontal" method="post" onsubmit="return false">
			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-qiniu-ak"><?= _('AK'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-qiniu-ak" name="qiniu-ak" value="<?= $basic['qiniu-ak']; ?>" />
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-qiniu-sk"><?= _('SK'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-qiniu-sk" name="qiniu-sk" value="<?= $basic['qiniu-sk']; ?>" />
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-qiniu-domain"><?= _('七牛域名'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-qiniu-domain" name="qiniu-domain" value="<?= $basic['qiniu-domain']; ?>" />
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-qiniu-bucket"><?= _('Bucket'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-qiniu-bucket" name="qiniu-bucket" value="<?= $basic['qiniu-bucket']; ?>" />
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-offset-1 col-sm-11">
					<button type="submit" class="btn btn-info"><?= _('保存') ?></button>
				</div>
			</div>
		</form>
	</div>
</div>


<form id="form-manage-domain" action="<?= $this->path('aj/manage/basic/savedomain') ?>" class="form-horizontal" method="post" onsubmit="return false">
	<div class="panel panel-info">
		<div class="panel-heading"><?= _('域名管理') ?></div>
		<div class="panel-body">
			<div class="form-group">
				<label class="col-sm-1 control-label" for="input-domain"><?= _('域名设置'); ?></label>
				<div class="col-sm-11">
					<input type="text" class="form-control" id="input-domain" name="domain" placeholder="<?= _('如果有自己的域名，请CNAME指向，并在此填入一个绑定的域名'); ?>" value="<?= $basic['domain'] ?>" />
					<span class="help-block"><?php printf(_('请将自己的域名添加一个CNAME记录，指向 %s，然后填入此处更新，即可使用自己的域名访问。'), '<em>' . \Model\Github::showDefaultBlogRepoName() . '</em>') ?></span>
				</div>
			</div>
			
			<div class="form-group">
				<div class="col-sm-offset-1 col-sm-11">
					<button type="submit" class="btn btn-info"><?= _('更新') ?></button>
				</div>
			</div>
		</div>
	</div>
</form>

<?php $this->_blockEnd(); ?>
<?php $this->_block('body_end')?>
<?php $this->js('manage/basic.js'); ?>
<?php $this->_blockEnd()?>
<?php $this->_blockLoad('_block/manage', ['nav'=>'basic']) ?>